﻿<%@ Page Title="Item Master Data" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true"
    EnableEventValidation="false" CodeBehind="VSMItemMasterData.aspx.cs" Inherits="VSM.Business.DataCenter.VSMItemMasterData" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div>
        <asp:UpdatePanel ID="updatePanel" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <asp:HiddenField ID="hdnCustomerCode" runat="server" />
                <asp:HiddenField ID="hdnID" runat="server" />
                <asp:HiddenField ID="hdnIsUpdate" runat="server" />
                <asp:HiddenField ID="hdnDocEntry" runat="server" />
                <asp:HiddenField ID="HiddenField1" runat="server" />
                <h2>
                    &nbsp;VSM - Item Master Data</h2>
                <div style="margin-left: 5px; width: 99%;">
                    <hr />
                    <table border="0" width="100%" style="border-collapse: collapse;">
                        <tr>
                            <td style="width: 150px; border-bottom: dotted 1px #808080; vertical-align: bottom;">
                                Spare Parts NBR:
                            </td>
                            <td valign="middle" style="width: 200px">
                                <asp:TextBox ID="txtSpareParts" runat="server" BackColor="#FF9966" 
                                    Font-Bold="True"></asp:TextBox>
                                    <cc1:AutoCompleteExtender ServiceMethod="GetItems" MinimumPrefixLength="4" CompletionInterval="100"
                                        EnableCaching="true" CompletionSetCount="10" TargetControlID="txtSpareParts"
                                        ID="AutoCompleteExtender1" runat="server" FirstRowSelected="true">
                                    </cc1:AutoCompleteExtender>
                            </td>
                            <td style="width: 110px">
                                <asp:Button ID="btnSearch" runat="server" BorderStyle="Solid" OnClick="btnSearch_Click"
                                    Style="background-image: url('/Images/bgButton.png'); background-repeat: no-repeat;
                                    color: White;" Text="Search" Width="100px" />
                            </td>
                            <td>
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td valign="bottom" style="border-bottom: dotted 1px #808080; vertical-align: bottom;">
                                Parts NBR:
                            </td>
                            <td valign="top">
                                <asp:TextBox ID="txtItemCode" runat="server"></asp:TextBox>
                            </td>
                            <td valign="top" colspan="2" rowspan="2">
                                <asp:GridView ID="grvWH" runat="server" CssClass="GridInner" BorderColor="White"
                                    BackColor="White" AllowSorting="True" AutoGenerateColumns="False" CellPadding="2"
                                    AllowPaging="false" HeaderStyle-Height="27px" OnRowDataBound="grdItem_RowDataBound"
                                    Width="100%">
                                    <RowStyle BackColor="#D9E0ED" ForeColor="Black" BorderColor="White" BorderWidth="2px"
                                        Height="25px" />
                                    <AlternatingRowStyle BackColor="#EEF1F7" BorderColor="White" BorderWidth="2px" Height="25px" />
                                    <Columns>
                                        <asp:TemplateField HeaderText="VSM">
                                            <ItemStyle HorizontalAlign="Center" Width="100px" />
                                            <HeaderStyle VerticalAlign="Middle" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblHCM" runat="server" Text='<%# Bind("VSM") %>' BorderStyle="none">
                                                </asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Ha Noi">
                                            <ItemStyle HorizontalAlign="Center" Width="100px" />
                                            <HeaderStyle VerticalAlign="Middle" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblHaNoi" runat="server" Text='<%# Bind("HaNoi") %>' BorderStyle="none">
                                                </asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                         <asp:TemplateField HeaderText="Production">
                                            <ItemStyle HorizontalAlign="Center" Width="100px" />
                                            <HeaderStyle VerticalAlign="Middle" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblProduction" runat="server" Text='<%# Bind("Production") %>' BorderStyle="none">
                                                </asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                    <PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Center" />
                                    <SelectedRowStyle BackColor="#9471DE" ForeColor="Red" />
                                    <HeaderStyle BackColor="#6095C9" ForeColor="#ffffff" Font-Overline="False" Height="27px"
                                        VerticalAlign="Middle" />
                                    <EmptyDataTemplate>
                                        <table class="GridInner" style="width: 100%; border-color: White;" border="1" rules="all"
                                            cellspacing="2" cellpadding="2">
                                            <tr valign="middle" style="height: 27px; color: white; text-decoration: none; background-color: rgb(96, 149, 201);
                                                text-align: center;">
                                                <th>
                                                    <span>VSM</span>
                                                </th>
                                                <th>
                                                    <span>Ha Noi</span>
                                                </th>
                                            </tr>
                                            <tr>
                                                <td colspan="3">
                                                    <span>No Data</span>
                                                </td>
                                            </tr>
                                        </table>
                                    </EmptyDataTemplate>
                                </asp:GridView>
                            </td>
                        </tr>
                        <tr>
                            <td style="border-bottom: dotted 1px #808080; vertical-align: bottom;">
                                Retail Price:
                            </td>
                            <td>
                                <asp:TextBox ID="txtUnitPrice" runat="server" MaxLength="90" OnKeyPress="return isNumberKey(this, event);"
                                    Style="text-align: right;">0</asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td style="border-bottom: dotted 1px #808080; vertical-align: bottom;">
                                VSP:
                            </td>
                            <td>
                                <asp:TextBox ID="txtVSP" runat="server" OnKeyPress="return isNumberKey(this, event);"
                                    Style="text-align: right;">0</asp:TextBox>
                            </td>
                            <td colspan="2" rowspan="5">
                                <asp:GridView ID="grvWH1" runat="server" AllowPaging="false" AllowSorting="True"
                                    AutoGenerateColumns="False" BackColor="White" BorderColor="White" CellPadding="2"
                                    CssClass="GridInner" HeaderStyle-Height="27px" OnRowDataBound="grdItem_RowDataBound"
                                    Width="100%">
                                    <RowStyle BackColor="#D9E0ED" BorderColor="White" BorderWidth="2px" ForeColor="Black"
                                        Height="25px" />
                                    <AlternatingRowStyle BackColor="#EEF1F7" BorderColor="White" BorderWidth="2px" Height="25px" />
                                    <Columns>
                                        <asp:TemplateField HeaderText="Purchased">
                                            <ItemStyle HorizontalAlign="Center" Width="100px" />
                                            <HeaderStyle VerticalAlign="Middle" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblPurchased" runat="server" BorderStyle="none" Text='<%# Bind("Purchased") %>'>
                                                </asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Received">
                                            <ItemStyle HorizontalAlign="Center" Width="100px" />
                                            <HeaderStyle VerticalAlign="Middle" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblReceived" runat="server" BorderStyle="none" Text='<%# Bind("Received") %>'>
                                                </asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="I-T B/O">
                                            <ItemStyle HorizontalAlign="Center" Width="100px" />
                                            <HeaderStyle VerticalAlign="Middle" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblTBO" runat="server" BorderStyle="none" Text='<%# Bind("TBO") %>'>
                                                </asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="I-R B/O">
                                            <ItemStyle HorizontalAlign="Center" Width="100px" />
                                            <HeaderStyle VerticalAlign="Middle" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblABO" runat="server" BorderStyle="none" Text='<%# Bind("ABO") %>'>
                                                </asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="On Stock">
                                            <ItemStyle HorizontalAlign="Center" Width="100px" />
                                            <HeaderStyle VerticalAlign="Middle" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblOnStock" runat="server" BorderStyle="none" Text='<%# Bind("OnStock") %>'>
                                                </asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Ordered">
                                            <ItemStyle HorizontalAlign="Center" Width="100px" />
                                            <HeaderStyle VerticalAlign="Middle" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblOrdered" runat="server" BorderStyle="none" Text='<%# Bind("Ordered") %>'>
                                                </asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Shipped">
                                            <ItemStyle HorizontalAlign="Center" Width="100px" />
                                            <HeaderStyle VerticalAlign="Middle" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblShipped" runat="server" BorderStyle="none" Text='<%# Bind("Shipped") %>'>
                                                </asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="B/O Total">
                                            <ItemStyle HorizontalAlign="Center" Width="100px" />
                                            <HeaderStyle VerticalAlign="Middle" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblBOTotal" runat="server" BorderStyle="none" Text='<%# Bind("Total") %>'>
                                                </asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                    <PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Center" />
                                    <SelectedRowStyle BackColor="#9471DE" ForeColor="Red" />
                                    <HeaderStyle BackColor="#6095C9" Font-Overline="False" ForeColor="#ffffff" Height="27px"
                                        VerticalAlign="Middle" />
                                    <EmptyDataTemplate>
                                        <table border="1" cellpadding="2" cellspacing="2" class="GridInner" rules="all" style="width: 100%;
                                            border-color: White;">
                                            <tr style="height: 27px; color: white; text-decoration: none; background-color: rgb(96, 149, 201);
                                                text-align: center;" valign="middle">
                                                <th>
                                                    <span>Purchased</span>
                                                </th>
                                                <th>
                                                    <span>Received</span>
                                                </th>
                                                <th>
                                                    <span>B/O</span>
                                                </th>
                                                <th>
                                                    <span>B/O</span>
                                                </th>
                                                <th>
                                                    <span>On Stock</span>
                                                </th>
                                                <th>
                                                    <span>Ordered</span>
                                                </th>
                                                <th>
                                                    <span>Shipped</span>
                                                </th>
                                                <th>
                                                    <span>B/O Total</span>
                                                </th>
                                            </tr>
                                            <tr>
                                                <td colspan="8">
                                                    <span>No Data</span>
                                                </td>
                                            </tr>
                                        </table>
                                    </EmptyDataTemplate>
                                </asp:GridView>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                &nbsp;
                            </td>
                            <td>
                                &nbsp;
                            </td>
                        </tr>
                    </table>
                    <table border="0" style="width: 100%">
                        <tr>
                            <td colspan="7">
                                <asp:GridView ID="grvStock" runat="server" Width="100%" GridLines="Both" BorderColor="White">
                                    <RowStyle BackColor="#D9E0ED" BorderColor="White" BorderWidth="2px" Height="25px"
                                        HorizontalAlign="Center" />
                                    <AlternatingRowStyle BackColor="#EEF1F7" BorderColor="White" BorderWidth="2px" HorizontalAlign="Center" />
                                    <HeaderStyle BackColor="#6095C9" ForeColor="#ffffff" Font-Overline="False" Height="27px"
                                        VerticalAlign="Middle" HorizontalAlign="Center" />
                                </asp:GridView>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                &nbsp;
                            </td>
                            <td style="width: 244px">
                                &nbsp;
                            </td>
                            <td style="width: 190px">
                                &nbsp;
                            </td>
                            <td style="width: 530px">
                                &nbsp;
                            </td>
                            <td style="width: 52px">
                                &nbsp;
                            </td>
                            <td style="width: 530px">
                                &nbsp;
                            </td>
                            <td style="width: 530px">
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td style="border-bottom: dotted 1px #808080; vertical-align: bottom; width: 213px;">
                                <strong>Supper Seding: </strong>
                            </td>
                            <td style="width: 244px">
                                <asp:TextBox ID="txtSeding" runat="server"></asp:TextBox>
                            </td>
                            <td style="width: 190px; border-bottom: dotted 1px #808080; vertical-align: bottom;">
                                Replace:
                            </td>
                            <td style="width: 530px">
                                <asp:TextBox ID="txtReplace" runat="server"></asp:TextBox>
                            </td>
                            <td style="width: 52px">
                                &nbsp;
                            </td>
                            <td style="width: 530px; border-bottom: dotted 1px #808080; vertical-align: bottom;">
                                <strong>Deal - Slow moving items:</strong>
                            </td>
                            <td style="width: 530px">
                                <asp:TextBox ID="txtDeal" runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td style="border-bottom: dotted 1px #808080; vertical-align: bottom; width: 213px;">
                                Parts Name:
                            </td>
                            <td colspan="3">
                                <asp:TextBox ID="txtItemName" runat="server" Width="99%"></asp:TextBox>
                            </td>
                            <td style="width: 52px">
                                &nbsp;
                            </td>
                            <td colspan="2" rowspan="8" valign="top">
                                <table style="width: 100%;" border="0">
                                    <tr>
                                        <td colspan="2">
                                            <asp:GridView ID="grvItem" runat="server" CssClass="GridInner" BorderColor="White"
                                                BackColor="White" AllowSorting="True" AutoGenerateColumns="False" CellPadding="2"
                                                AllowPaging="false" HeaderStyle-Height="27px" OnRowDataBound="grdItem_RowDataBound"
                                                Width="100%">
                                                <RowStyle BackColor="#D9E0ED" ForeColor="Black" BorderColor="White" BorderWidth="2px"
                                                    Height="25px" />
                                                <AlternatingRowStyle BackColor="#EEF1F7" BorderColor="White" BorderWidth="2px" Height="25px" />
                                                <Columns>
                                                    <asp:TemplateField HeaderText="Old Part NBR">
                                                        <ItemStyle HorizontalAlign="Center" Width="100px" />
                                                        <HeaderStyle VerticalAlign="Middle" />
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblOldPartNBR" runat="server" Text='<%# Bind("U_OldPartNBR") %>' BorderStyle="none">
                                                            </asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Model">
                                                        <ItemStyle HorizontalAlign="Center" Width="100px" />
                                                        <HeaderStyle VerticalAlign="Middle" />
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblModel" runat="server" Text='<%# Bind("U_Model") %>' BorderStyle="none">
                                                            </asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                </Columns>
                                                <PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Center" />
                                                <SelectedRowStyle BackColor="#9471DE" ForeColor="Red" />
                                                <HeaderStyle BackColor="#6095C9" ForeColor="#ffffff" Font-Overline="False" Height="27px"
                                                    VerticalAlign="Middle" />
                                                <EmptyDataTemplate>
                                                    <table class="GridInner" style="width: 100%; border-color: White;" border="1" rules="all"
                                                        cellspacing="2" cellpadding="2">
                                                        <tr valign="middle" style="height: 27px; color: white; text-decoration: none; background-color: rgb(96, 149, 201);
                                                            text-align: center;">
                                                            <th>
                                                                <span>Old Part NBR</span>
                                                            </th>
                                                            <th>
                                                                <span>Model</span>
                                                            </th>
                                                        </tr>
                                                        <tr>
                                                            <td colspan="2">
                                                                <span>No Data</span>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </EmptyDataTemplate>
                                            </asp:GridView>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width: 110px; border-bottom: dotted 1px #808080; vertical-align: bottom;">
                                            Group NBR:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtGroupNBR" runat="server"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width: 110px; border-bottom: dotted 1px #808080; vertical-align: bottom;">
                                            Part Name Code:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtPartNameCode" runat="server"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width: 110px; border-bottom: dotted 1px #808080; vertical-align: bottom;">
                                            Location:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtLocation" runat="server"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width: 110px; border-bottom: dotted 1px #808080; vertical-align: bottom;">
                                            Sub Location:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtSubLocation" runat="server"></asp:TextBox>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td style="border-bottom: dotted 1px #808080; vertical-align: bottom; width: 213px;">
                                VN Name:
                            </td>
                            <td colspan="3">
                                <asp:TextBox ID="txtForeignName" runat="server" Width="99%"></asp:TextBox>
                            </td>
                            <td style="width: 52px">
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td style="border-bottom: dotted 1px #808080; vertical-align: bottom; width: 213px;">
                                Unit:
                            </td>
                            <td style="width: 244px">
                                <asp:TextBox ID="txtUnit" runat="server"  ></asp:TextBox>
                            </td>
                            <td style="width: 190px; border-bottom: dotted 1px #808080; vertical-align: bottom;">
                                Model:
                            </td>
                            <td style="width: 530px">
                                <asp:TextBox ID="txtModel" runat="server"></asp:TextBox>
                            </td>
                            <td style="width: 52px">
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td style="border-bottom: dotted 1px #808080; vertical-align: bottom; width: 213px;">
                                EPL
                            </td>
                            <td style="width: 244px">
                                <asp:DropDownList ID="dllPriceList" runat="server" Visible="False">
                                    <asp:ListItem Value="1">EPL</asp:ListItem>
                                </asp:DropDownList>
                                <asp:TextBox ID="txtEPLPrice" runat="server"  Style="text-align: right;"></asp:TextBox>
                            </td>
                            <td style="width: 190px; border-bottom: dotted 1px #808080; vertical-align: bottom;">
                                RM:
                            </td>
                            <td style="width: 530px">
                                <asp:TextBox ID="txtRM" runat="server"></asp:TextBox>
                            </td>
                            <td style="width: 52px">
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td style="border-bottom: dotted 1px #808080; vertical-align: bottom; width: 213px;">
                                Tax ID:
                            </td>
                            <td style="width: 244px">
                                <asp:TextBox ID="txtTaxID" runat="server"></asp:TextBox>
                            </td>
                            <td style="width: 190px; border-bottom: dotted 1px #808080; vertical-align: bottom;">
                                Vendors ID:
                            </td>
                            <td style="width: 530px">
                                <asp:TextBox ID="txtVendorID" runat="server"></asp:TextBox>
                            </td>
                            <td style="width: 52px">
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td style="border-bottom: dotted 1px #808080; vertical-align: bottom; width: 213px;">
                                Unit PGK
                            </td>
                            <td style="width: 244px">
                                <asp:TextBox ID="txtPGK" runat="server" Style="text-align: right;"></asp:TextBox>
                            </td>
                            <td style="width: 190px; border-bottom: dotted 1px #808080; vertical-align: bottom;">
                                Class:
                            </td>
                            <td style="width: 530px">
                                <asp:TextBox ID="txtClass" runat="server"></asp:TextBox>
                            </td>
                            <td style="width: 52px">
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td>
                                &nbsp;
                            </td>
                            <td style="width: 244px">
                                &nbsp;
                            </td>
                            <td style="width: 190px; border-bottom: dotted 1px #808080; vertical-align: bottom;">
                                N/W:
                            </td>
                            <td style="width: 530px">
                                <asp:TextBox ID="txtNW" runat="server"></asp:TextBox>
                            </td>
                            <td style="width: 52px">
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td>
                                &nbsp;
                            </td>
                            <td style="width: 244px">
                                &nbsp;
                            </td>
                            <td style="width: 190px">
                                &nbsp;
                            </td>
                            <td style="width: 530px">
                                &nbsp;
                            </td>
                            <td style="width: 52px">
                                &nbsp;
                            </td>
                        </tr>
                    </table>
                    <table>
                        <tr>
                            <td>
                                Remarks:
                            </td>
                            <td>
                                <asp:TextBox ID="txtRemarks" runat="server" Height="82px" TextMode="MultiLine" Width="745px"></asp:TextBox>
                            </td>
                        </tr>
                    </table>
                </div>
                <hr />
                <table width="100%" border="0">
                    <tr>
                        <td>
                            <table style="width: 100%">
                                <tr>
                                    <td style="width: 220px;">
                                        <asp:Button ID="btnUpdate" runat="server" Text="Save" OnClick="btnUpdate_Click" Style="background-image: url('/Images/bgButton.png');
                                            background-repeat: no-repeat; color: White;" BorderStyle="Solid" Width="100px" />
                                        <asp:Button ID="btnClear" runat="server" BorderStyle="Solid" 
                                            OnClick="btnClear_Click" 
                                            Style="background-image: url('/Images/bgButton.png'); background-repeat: no-repeat; color: White;" 
                                            Text="Clear" Width="100px" />
                                    </td>
                                    <td>
                                        <asp:Label ID="lblError" runat="server" Font-Bold="True" ForeColor="Red" Visible="False"></asp:Label>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
                <asp:Timer ID="Timer1" runat="server" Interval="1" OnTick="Timer1_Tick" />
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
</asp:Content>
